package org.kfive.nova.test.service.impl;

import org.kfive.nova.test.betadao.AddressDao;
import org.kfive.nova.test.model.Address;
import org.kfive.nova.test.service.AddressService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.Assert;

/*
* AddressServiceImpl.java
* Created  by  dell
* Created on 2016/3/29 11:03
*/
public class AddressServiceImpl implements AddressService {

    @Autowired
    private AddressDao addressDao;

    @Override
    public Integer saveAddress(Address address) {
        Assert.notNull(address, "地址不能为空");
        Integer addressId = this.addressDao.save(address);
        Assert.notNull(addressId,"地址保存失败");
        return addressId;
    }
}
